package com.student.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * RpList entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "RP_List", schema = "dbo", catalog = "StudentManager")
public class RpList implements java.io.Serializable {

	// Fields

	private Long rpId;
	private String rpName;
	private Set<DormRpAssociation> dormRpAssociations = new HashSet<DormRpAssociation>(
			0);
	private Set<StudentRpAssciation> studentRpAssciations = new HashSet<StudentRpAssciation>(
			0);
	private Set<ClassAppraiseAssociation> classAppraiseAssociations = new HashSet<ClassAppraiseAssociation>(
			0);

	// Constructors

	/** default constructor */
	public RpList() {
	}

	/** minimal constructor */
	public RpList(Long rpId, String rpName) {
		this.rpId = rpId;
		this.rpName = rpName;
	}

	/** full constructor */
	public RpList(Long rpId, String rpName,
			Set<DormRpAssociation> dormRpAssociations,
			Set<StudentRpAssciation> studentRpAssciations,
			Set<ClassAppraiseAssociation> classAppraiseAssociations) {
		this.rpId = rpId;
		this.rpName = rpName;
		this.dormRpAssociations = dormRpAssociations;
		this.studentRpAssciations = studentRpAssciations;
		this.classAppraiseAssociations = classAppraiseAssociations;
	}

	// Property accessors
	@Id
	@Column(name = "RP_id", unique = true, nullable = false, precision = 18, scale = 0)
	@GeneratedValue
	public Long getRpId() {
		return this.rpId;
	}

	public void setRpId(Long rpId) {
		this.rpId = rpId;
	}

	@Column(name = "RP_Name", nullable = false, length = 256)
	public String getRpName() {
		return this.rpName;
	}

	public void setRpName(String rpName) {
		this.rpName = rpName;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "rpList")
	public Set<DormRpAssociation> getDormRpAssociations() {
		return this.dormRpAssociations;
	}

	public void setDormRpAssociations(Set<DormRpAssociation> dormRpAssociations) {
		this.dormRpAssociations = dormRpAssociations;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "rpList")
	public Set<StudentRpAssciation> getStudentRpAssciations() {
		return this.studentRpAssciations;
	}

	public void setStudentRpAssciations(
			Set<StudentRpAssciation> studentRpAssciations) {
		this.studentRpAssciations = studentRpAssciations;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "rpList")
	public Set<ClassAppraiseAssociation> getClassAppraiseAssociations() {
		return this.classAppraiseAssociations;
	}

	public void setClassAppraiseAssociations(
			Set<ClassAppraiseAssociation> classAppraiseAssociations) {
		this.classAppraiseAssociations = classAppraiseAssociations;
	}

}